package com.you.redis.sentinel;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisSentinelPool;

import java.util.HashSet;
import java.util.Set;

/**
 * 测试通过Redis Sentinel操作redis
 */
public class JedisSentinel {

    public static void main(String[] args) throws Exception {
        JedisSentinelPool jedisSentinelPool = JedisSentinelUtils.getInstance().getJedisSentinelPool();
        Jedis jedis = jedisSentinelPool.getResource();
        jedis.set("age", "200");
        System.out.println(jedis.get("age"));
        jedisSentinelPool.destroy();
    }
}
